
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>调试技巧 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="Performance-optimization.html" />
    
    
    <link rel="prev" href="Component-based.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    关于
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Part I</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="Data-structure.html">
            
                <a href="Data-structure.html">
            
                    
                    数据结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="Arithmetic.html">
            
                <a href="Arithmetic.html">
            
                    
                    算法
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Part II</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="Foundation.html">
            
                <a href="Foundation.html">
            
                    
                    Foundation
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="UIKit.html">
            
                <a href="UIKit.html">
            
                    
                    UIKit
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="WebView.html">
            
                <a href="WebView.html">
            
                    
                    WebView
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.4" data-path="Memory-management.html">
            
                <a href="Memory-management.html">
            
                    
                    内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="Message-passing.html">
            
                <a href="Message-passing.html">
            
                    
                    消息传递的方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="Network.html">
            
                <a href="Network.html">
            
                    
                    网络
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="Data-storage.html">
            
                <a href="Data-storage.html">
            
                    
                    数据存储
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.8" data-path="Multi-thread.html">
            
                <a href="Multi-thread.html">
            
                    
                    多线程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.9" data-path="Animation.html">
            
                <a href="Animation.html">
            
                    
                    动画
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.10" data-path="Image-processing.html">
            
                <a href="Image-processing.html">
            
                    
                    图像处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.11" data-path="Data-encryption.html">
            
                <a href="Data-encryption.html">
            
                    
                    数据安全及加密
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.12" data-path="Runtime.html">
            
                <a href="Runtime.html">
            
                    
                    Runtime
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.13" data-path="Runloop.html">
            
                <a href="Runloop.html">
            
                    
                    Runloop
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Part III</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="Project-organization.html">
            
                <a href="Project-organization.html">
            
                    
                    项目架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="Design-patterns.html">
            
                <a href="Design-patterns.html">
            
                    
                    设计模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="Component-based.html">
            
                <a href="Component-based.html">
            
                    
                    组件化
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="4.4" data-path="Debug-tips.html">
            
                <a href="Debug-tips.html">
            
                    
                    调试技巧
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="Performance-optimization.html">
            
                <a href="Performance-optimization.html">
            
                    
                    性能优化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.6" data-path="Source-code.html">
            
                <a href="Source-code.html">
            
                    
                    源码理解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.7" data-path="Code-management.html">
            
                <a href="Code-management.html">
            
                    
                    代码管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.8" data-path="Continuous-integration.html">
            
                <a href="Continuous-integration.html">
            
                    
                    持续集成
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >调试技巧</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x8C03;&#x8BD5;&#x6280;&#x5DE7;">&#x8C03;&#x8BD5;&#x6280;&#x5DE7;</h1>
<h2 id="1lldb&#x5E38;&#x7528;&#x7684;&#x8C03;&#x8BD5;&#x547D;&#x4EE4;&#xFF1F;">1.LLDB&#x5E38;&#x7528;&#x7684;&#x8C03;&#x8BD5;&#x547D;&#x4EE4;&#xFF1F;</h2>
<ul>
<li><p>po&#xFF1A;print object&#x7684;&#x7F29;&#x5199;&#xFF0C;&#x8868;&#x793A;&#x663E;&#x793A;&#x5BF9;&#x8C61;&#x7684;&#x6587;&#x672C;&#x63CF;&#x8FF0;&#xFF0C;&#x5982;&#x679C;&#x5BF9;&#x8C61;&#x4E0D;&#x5B58;&#x5728;&#x5219;&#x6253;&#x5370;nil&#x3002;</p>
</li>
<li><p>p&#xFF1A;&#x53EF;&#x4EE5;&#x7528;&#x6765;&#x6253;&#x5370;&#x57FA;&#x672C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x3002;</p>
</li>
<li><p>call&#xFF1A;&#x6267;&#x884C;&#x4E00;&#x6BB5;&#x4EE3;&#x7801; &#x5982;&#xFF1A;call NSLog(@&quot;%@&quot;, @&quot;yang&quot;)</p>
</li>
<li><p>expr&#xFF1A;&#x52A8;&#x6001;&#x6267;&#x884C;&#x6307;&#x5B9A;&#x8868;&#x8FBE;&#x5F0F;</p>
</li>
<li><p>bt&#xFF1A;&#x6253;&#x5370;&#x5F53;&#x524D;&#x7EBF;&#x7A0B;&#x5806;&#x6808;&#x4FE1;&#x606F; &#xFF08;bt all &#x6253;&#x5370;&#x6240;&#x6709;&#x7EBF;&#x7A0B;&#x5806;&#x6808;&#x4FE1;&#x606F;&#xFF09;</p>
</li>
<li><p>image&#xFF1A;&#x5E38;&#x7528;&#x6765;&#x5BFB;&#x627E;&#x6808;&#x5730;&#x5740;&#x5BF9;&#x5E94;&#x4EE3;&#x7801;&#x4F4D;&#x7F6E; &#x5982;&#xFF1A;image lookup --address 0xxxx</p>
</li>
</ul>
<h2 id="2&#x65AD;&#x70B9;&#x8C03;&#x8BD5;">2.&#x65AD;&#x70B9;&#x8C03;&#x8BD5;</h2>
<ul>
<li><p>&#x6761;&#x4EF6;&#x65AD;&#x70B9;</p>
<p>  &#x6253;&#x4E0A;&#x65AD;&#x70B9;&#x4E4B;&#x540E;&#xFF0C;&#x5BF9;&#x65AD;&#x70B9;&#x8FDB;&#x884C;&#x7F16;&#x8F91;&#xFF0C;&#x8BBE;&#x7F6E;&#x76F8;&#x5E94;&#x8FC7;&#x6EE4;&#x6761;&#x4EF6;&#x3002;&#x4E0B;&#x9762;&#x7B80;&#x5355;&#x7684;&#x4ECB;&#x7ECD;&#x4E00;&#x4E0B;&#x6761;&#x4EF6;&#x8BBE;&#x7F6E;&#xFF1A;</p>
<p>  Condition&#xFF1A;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A;&#x5E03;&#x5C14;&#x503C;&#xFF0C;&#x5F53;&#x5E03;&#x5C14;&#x503C;&#x4E3A;&#x771F;&#x89E6;&#x53D1;&#x65AD;&#x70B9;&#xFF0C;&#x4E00;&#x822C;&#x91CC;&#x9762;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x5199;&#x4E00;&#x4E2A;&#x8868;&#x8FBE;&#x5F0F;&#x3002;</p>
<p>  Ignore&#xFF1A;&#x5FFD;&#x7565;&#x524D;N&#x6B21;&#x65AD;&#x70B9;&#xFF0C;&#x5230;N+1&#x6B21;&#x518D;&#x89E6;&#x53D1;&#x65AD;&#x70B9;&#x3002;</p>
<p>  Action&#xFF1A;&#x65AD;&#x70B9;&#x89E6;&#x53D1;&#x4E8B;&#x4EF6;&#xFF0C;&#x5206;&#x4E3A;&#x516D;&#x79CD;&#xFF1A;</p>
<ul>
<li><p>AppleScript&#xFF1A;&#x6267;&#x884C;&#x811A;&#x672C;&#x3002;</p>
</li>
<li><p>Capture GPU Frame&#xFF1A;&#x7528;&#x4E8E;OpenGL ES&#x8C03;&#x8BD5;&#xFF0C;&#x6355;&#x83B7;&#x65AD;&#x70B9;&#x5904;GPU&#x5F53;&#x524D;&#x7ED8;&#x5236;&#x5E27;&#x3002;</p>
</li>
<li><p>Debugger Command&#xFF1A;&#x548C;&#x63A7;&#x5236;&#x53F0;&#x4E2D;&#x8F93;&#x5165;LLDB&#x8C03;&#x8BD5;&#x547D;&#x4EE4;&#x4E00;&#x81F4;&#x3002;</p>
</li>
<li><p>Log Message&#xFF1A;&#x8F93;&#x51FA;&#x81EA;&#x5B9A;&#x4E49;&#x683C;&#x5F0F;&#x4FE1;&#x606F;&#x81F3;&#x63A7;&#x5236;&#x53F0;&#x3002;</p>
</li>
<li><p>Shell Command&#xFF1A;&#x63A5;&#x6536;&#x547D;&#x4EE4;&#x6587;&#x4EF6;&#x53CA;&#x76F8;&#x5E94;&#x53C2;&#x6570;&#x5217;&#x8868;&#xFF0C;Shell Command&#x662F;&#x5F02;&#x6B65;&#x6267;&#x884C;&#x7684;&#xFF0C;&#x53EA;&#x6709;&#x52FE;&#x9009;&#x201C;Wait until done&#x201D;&#x624D;&#x4F1A;&#x7B49;&#x5F85;Shell&#x547D;&#x4EE4;&#x6267;&#x884C;&#x5B8C;&#x5728;&#x6267;&#x884C;&#x8C03;&#x8BD5;&#x3002;</p>
</li>
<li><p>Sound&#xFF1A;&#x65AD;&#x70B9;&#x89E6;&#x53D1;&#x65F6;&#x64AD;&#x653E;&#x58F0;&#x97F3;&#x3002;</p>
<p>Options(Automatically continue after evaluating actions&#x9009;&#x9879;)&#xFF1A;&#x9009;&#x4E2D;&#x540E;&#xFF0C;&#x8868;&#x793A;&#x65AD;&#x70B9;&#x4E0D;&#x4F1A;&#x7EC8;&#x6B62;&#x7A0B;&#x5E8F;&#x7684;&#x8FD0;&#x884C;&#x3002;</p>
</li>
</ul>
</li>
<li><p>&#x5F02;&#x5E38;&#x65AD;&#x70B9;</p>
<p>  &#x5F02;&#x5E38;&#x65AD;&#x70B9;&#x53EF;&#x4EE5;&#x5FEB;&#x901F;&#x5B9A;&#x4F4D;&#x4E0D;&#x6EE1;&#x8DB3;&#x7279;&#x5B9A;&#x6761;&#x4EF6;&#x7684;&#x5F02;&#x5E38;&#xFF0C;&#x6BD4;&#x5982;&#x5E38;&#x89C1;&#x7684;&#x6570;&#x7EC4;&#x8D8A;&#x754C;&#xFF0C;&#x8FD9;&#x65F6;&#x5019;&#x5F88;&#x96BE;&#x901A;&#x8FC7;&#x5F02;&#x5E38;&#x4FE1;&#x606F;&#x5B9A;&#x4F4D;&#x5230;&#x9519;&#x8BEF;&#x6240;&#x5728;&#x4F4D;&#x7F6E;&#x3002;&#x8FD9;&#x4E2A;&#x65F6;&#x5019;&#x5F02;&#x5E38;&#x65AD;&#x70B9;&#x5C31;&#x53EF;&#x4EE5;&#x53D1;&#x6325;&#x4F5C;&#x7528;&#x4E86;&#x3002;</p>
<p>  Exception&#xFF1A;&#x53EF;&#x4EE5;&#x9009;&#x62E9;&#x629B;&#x51FA;&#x5F02;&#x5E38;&#x5BF9;&#x8C61;&#x7C7B;&#x578B;&#xFF1A;OC&#x6216;C++&#x3002;</p>
<p>  Break&#xFF1A;&#x9009;&#x62E9;&#x65AD;&#x70B9;&#x63A5;&#x6536;&#x7684;&#x629B;&#x51FA;&#x5F02;&#x5E38;&#x6765;&#x6E90;&#x662F;Throw&#x8FD8;&#x662F;Catch&#x8BED;&#x53E5;&#x3002;</p>
</li>
<li><p>&#x7B26;&#x53F7;&#x65AD;&#x70B9;</p>
<p>  &#x7B26;&#x53F7;&#x65AD;&#x70B9;&#x7684;&#x521B;&#x5EFA;&#x65B9;&#x5F0F;&#x548C;&#x5F02;&#x5E38;&#x65AD;&#x70B9;&#x4E00;&#x6837;&#x4E00;&#x6837;&#x7684;&#xFF0C;&#x5728;&#x7B26;&#x53F7;&#x65AD;&#x70B9;&#x4E2D;&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x8981;&#x4E2D;&#x65AD;&#x6267;&#x884C;&#x7684;&#x65B9;&#x6CD5;&#xFF1A;</p>
<p>  Symbol:[&#x7C7B;&#x540D; &#x65B9;&#x6CD5;&#x540D;]&#x53EF;&#x4EE5;&#x6267;&#x884C;&#x5230;&#x6307;&#x5B9A;&#x7C7B;&#x7684;&#x6307;&#x5B9A;&#x65B9;&#x6CD5;&#x4E2D;&#x5F00;&#x59CB;&#x65AD;&#x70B9;&#x3002;</p>
</li>
</ul>
<h2 id="3ios-&#x5E38;&#x89C1;&#x7684;&#x5D29;&#x6E83;&#x7C7B;&#x578B;&#x6709;&#x54EA;&#x4E9B;&#xFF1F;">3.iOS &#x5E38;&#x89C1;&#x7684;&#x5D29;&#x6E83;&#x7C7B;&#x578B;&#x6709;&#x54EA;&#x4E9B;&#xFF1F;</h2>
<ul>
<li><p>unrecognized selector crash</p>
</li>
<li><p>KVO crash</p>
</li>
<li><p>NSNotification crash</p>
</li>
<li><p>NSTimer crash</p>
</li>
<li><p>Container crash</p>
</li>
<li><p>NSString crash</p>
</li>
<li><p>Bad Access crash &#xFF08;&#x91CE;&#x6307;&#x9488;&#xFF09;</p>
</li>
<li><p>UI not on Main Thread Crash</p>
</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="Component-based.html" class="navigation navigation-prev " aria-label="Previous page: 组件化">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="Performance-optimization.html" class="navigation navigation-next " aria-label="Next page: 性能优化">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"调试技巧","level":"4.4","depth":1,"next":{"title":"性能优化","level":"4.5","depth":1,"path":"Performance-optimization.md","ref":"Performance-optimization.md","articles":[]},"previous":{"title":"组件化","level":"4.3","depth":1,"path":"Component-based.md","ref":"Component-based.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"Debug-tips.md","mtime":"2020-04-13T10:23:32.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-05-27T09:12:21.691Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

